x86, hvm: Fix double-free of vpmu->context
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 19 Mar 2009 10:05:01 +0000 (10:05 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 19 Mar 2009 10:05:01 +0000 (10:05 +0000)
commitd532e54c26d054c9ba97ecb0429ddfb7842e2f52
treea4a33d374dde3476ee5ba6107f893b168b2c4124
parentd046c2261f88fd7dd5eb274f2847eb66f0dae1c9
x86, hvm: Fix double-free of vpmu->context

When `opcontrol --shutdown' is called after xenoprof is used on Dom0,
the vpmu owner becomes PMU_OWNER_NONE. So it is possible to acquire
the owner as PMU_OWNER_HVM and to allocate vpmu->context twice. As a
result, the hypervisor panics because of double-alloc/free of
vpmu->context.

Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
xen/arch/x86/hvm/vmx/vpmu_core2.c
xen/arch/x86/oprofile/op_model_ppro.c